//
// Created by Semir on 2020/4/2.
//

#include <iostream>

using namespace std;

const int MAX_DISHES_NUM = 105;
const int MAX_MONEY_NUM = 10005;
int n, m;
int a[MAX_DISHES_NUM];
int dp[MAX_DISHES_NUM][MAX_MONEY_NUM];
int d[MAX_MONEY_NUM];

void method1() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = 1; i <= n; i++) {
        int j = 1;
        for (; j < a[i]; j++) {
            dp[i][j] = dp[i - 1][j];
        }
        dp[i][j] = dp[i - 1][j] + 1;
        for (j = a[i] + 1; j <= m; j++) {
            dp[i][j] = dp[i - 1][j] + dp[i - 1][j - a[i]];
        }
    }
    cout << dp[n][m] << endl;
}

void method2() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        int j = 0;
        for (; j < a[i]; j++) {
            dp[i][j] = dp[i - 1][j];
        }
        for (; j <= m; j++) {
            dp[i][j] = dp[i - 1][j] + dp[i - 1][j - a[i]];
        }
    }
    cout << dp[n][m] << endl;
}

int main() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    d[0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = m; j >= a[i]; j--) {
            d[j] = d[j] + d[j - a[i]];
        }
    }
    cout << d[m] << endl;
    return 0;
}